<?
	session_start();
	require("checksessionadmin.php");
	require("connect.php");	
?>
<html><!-- InstanceBegin template="/Templates/admintemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javascript" src="../scripts/innovaeditor.js"></script>
<link rel="stylesheet" type="text/css" href="../css/engine.css" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script language="javascript" type="text/javascript" src="../js/datetimepicker.js">
</script>
</head>
<body>
<table align="center" width="960px" cellpadding="0" cellspacing="0" border="0">
<tr><td colspan="2" height="124" valign="top" align="center">
	<object classid="clsidsmilie27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="960" height="124" align="absmiddle">
   <param name="movie" value="flash/banneradmin.swf" />
   <param name="quality" value="high" />
   <embed src="../flash/banneradmin.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="960" height="124" align="absmiddle"></embed>
 	</object>
</td></tr>
<tr><td colspan="2" height="34">	
	<div id="menuadmin">
		<ul id="p7menubar">
			 <li><a class="trigger" href="index.php" target="_self">Trang chủ admin</a></li>
			 <li class="linemenus"></li>					 
		 	 <li><a class="trigger" href="../index.php" target="_self">Trang chủ trường</a>									  	
		  	<li class="linemenus"></li>					 
		  	<li><a class="trigger" href="thongtincanhanadmin.php" target="_self">Thông tin cá nhân</a>			
			<li class="linemenus"></li>					 
		  	<li><a class="trigger" href="../logout.php" target="_self">Thoát</a>	
			<li class="linemenus"></li>	
			<li><a class="trigger">							
				<?
				$nguoidung=$_SESSION["username"];
				if($_SESSION["quyen"]==0){
				$resu23=mysql_query("select * from admin where maadmin='{$nguoidung}'");
				$row23=mysql_fetch_array($resu23);
				?>
					<font color="#FFFFFF">			 
					<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
					</font>
				<? }?>	
			</a>							
		  <!--het-->
		</ul>
	</div>	
	</td>
</tr>
<tr>
<td valign="top" align="left" height="750" width="180">
	<!--menu trai-->
		<table align="center" width="100%" border="1" cellpadding="0" cellspacing="0">
		<tr><td valign="middle" height="30">
			<a href="tintuc_admin.php"><img src="../anh/tintuc.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="tintuc_admin.php">Quản lý tin tức</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="loaitin_admin.php"><img src="../anh/loaitin.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="loaitin_admin.php">Quản lý loại tin</a>
		</td></tr>		
		<tr><td valign="middle" height="30">
				<a href="lopctn_admin.php"><img src="../anh/lopctn.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="lopctn_admin.php">Quản lý lớp</a>
		</td></tr>
		
		<tr><td valign="middle" height="30">
			<a href="tobomon_admin.php"><img src="../anh/tobomon.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="tobomon_admin.php">Quản lý tổ giáo viên</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="giaovien_admin.php"><img src="../anh/giaovien.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="giaovien_admin.php">Quản lý giáo viên</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="phuhuynh_admin.php"><img src="../anh/phuhuynh.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="phuhuynh_admin.php">Quản lý phụ huynh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="hocsinh_admin_1.php"><img src="../anh/user.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="hocsinh_admin_1.php">Quản lý học sinh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thoikhoabieu_admin.php"><img src="../anh/thoikhoabieu.png" height="16" width="15" border="0">&nbsp;&nbsp;</a><a href="thoikhoabieu_admin.php">Quản lý thời khóa biểu</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="baiviet_admin.php"><img src="../anh/baiviet.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="baiviet_admin.php">Quản lý bài viết</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="monhoc_admin.php"><img src="../anh/monhoc.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="monhoc_admin.php">Quản lý môn học</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="tailieu_admin.php"><img src="../anh/tailieu.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="tailieu_admin.php">Quản lý tài liệu</a>
		</td></tr>
		<?
			$menu=$_REQUEST["opt"];
			if(($menu=="")||($menu==ko)){
		?>
			<tr><td valign="middle" height="30">
				<a href="?opt=co"><img src="../anh/thuvienanh.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="?opt=co">Quản lý thư viện ảnh</a>
			</td></tr>
		<? }else if($menu==co){?>
			<tr><td valign="middle" height="30">
				<a href="?opt=ko"><img src="../anh/thuvienanh.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="?opt=ko">Quản lý thư viện ảnh</a><br>
				&nbsp;<a href="thuvienanh_admin.php">
					<img src="../anh/1px.gif" height="15" width="16" border="0">
				</a><a href="thuvienanh_admin.php">Thư viện ảnh trường</a><br>
				&nbsp;<a href="thuvienanhlop_admin.php">
					<img src="../anh/1px.gif" height="15" width="16" border="0">
				</a><a href="thuvienanhlop_admin.php">Thư viện ảnh lớp</a>
			</td></tr>
		<? }?>
		
		<tr><td valign="middle" height="30">
			<a href="khoahoc_admin.php"><img src="../anh/khoahoc.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="khoahoc_admin.php">Quản lý khóa học</a>
		</td></tr>
		<!--
		<tr><td valign="middle" height="30">
			<a href="admin_admin.php"><img src="../anh/admin.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="admin_admin.php">Quản lý account</a>
		</td></tr>	
		-->
		<tr><td valign="middle" height="30">
			<a href="admin_sodaubai.php"><img src="../anh/sodaubai.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="sodaubai_admin.php">Quản lý sổ ghi đầu bài</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="admin_lienket.php"><img src="../anh/lienket.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="lienket_admin.php">Quản lý menu</a>
		</td></tr>		
		</table>
</td>
<!--Het menu trai-->
    <td valign="top" align="center"><!-- InstanceBeginEditable name="EditRegion3" -->
	<h3 align="center"><font color="#CC3333">Quản lý học sinh</font> </h3>		
	<div class="paneladmin">
			<div class="paneladmin_header"><font color="#003366">DANH SÁCH LỚP</font></div>
			<?
    	 $result=mysql_query("select * from lop order by tenl");
    	 if(mysql_error()!="")
    	 {
    	 	echo ("<center>Lỗi truy vấn !</center>");
    	 	
    	 }
    	 else {
    	 	if (mysql_num_rows($result)<=0)
    	 	{
    	 		echo ("<center>Chưa có lớp nào trong cơ sở dữ liệu !</center>");
				?>
				<center><a href="lopctn_admin_add.php">Thêm lớp chưa tốt nghiệp</A></center>				
				<?
    	 	}else { 						
			?>								
				<TABLE align="center" width="98%" border="0" cellpadding="5" cellspacing="0">
					<TR>
					<?
						$j=0;
					 while($r=mysql_fetch_array($result)) {
					 	$j++;
					 ?>							
								<td align="center">
									<a href="hocsinh_admin.php?mal=<? echo $r["mal"]?>" title="Danh sách học sinh">
										<img src="../anh/thongtin.png" height="16" width="16" border="0">
									</a> 
									<a href="hocsinh_admin.php?mal=<? echo $r["mal"]?>" title="Danh sách học sinh"><? echo $r["tenl"];?></a>
								</td>
							<?
							if($j==2){
							$j=0;
							?>
							</TR><tr>
							<? }?>
					<? }?>
							
			<?	
    	 	}
    	 }
    	 ?> 		 
    	 </TABLE>
	</div>
	<!--Begin cac cap nhat thong tin bo sung cua hoc sinh-->
	<div class="paneladmin">
			<div class="paneladmin_header"><font color="#003366">CÁC CẬP NHẬT THÔNG TIN BỔ SUNG CỦA HỌC SINH CHƯA XỬ LÝ</font></div>
			<table align="center" cellpadding="3" cellspacing="0" width="99%">
			<? 
				$result1=mysql_query("select * from thongtinhocsinh where trangthai='0'");
				if(mysql_num_rows($result1)<=0)
				{
					echo "<center>Chưa có cập nhật mới nào !</center>";
				}else{
					$num_page=ceil(mysql_num_rows($result1)/20);
					$page = $_REQUEST["page"];
					if($page <= 0) $page = 1;
					if($page > $num_page) $page = $num_page;
					$a = ($page - 1)*20;
					$result2 = mysql_query("select * from thongtinhocsinh where trangthai='0' order by thoigian DESC limit {$a},20");
					while($r2=mysql_fetch_array($result2)){
						$result3=mysql_query("select * from hocsinh where mahs='{$r2["mahs"]}'");	
						$r3=mysql_fetch_array($result3);
				?>
						<tr>
							<td><a href="hocsinh_admin_detail.php?mahs=<? echo $r2["mahs"];?>&option=xem" title="Chi tiết">
									<img src="../anh/thongtin.png" height="16" width="16" border="0"></a>&nbsp;Học sinh
								<a href="hocsinh_admin_detail.php?mahs=<? echo $r2["mahs"];?>&option=xem" title="Chi tiết">
									 <? echo $r3["hotendem"];echo "&nbsp;";echo $r3["ten"];?>
								</a>&nbsp;
							thời gian <? echo $r2["thoigian"];?>&nbsp;&nbsp;
							<a href="hocsinh_admin_detail.php?mahs=<? echo $r2["mahs"];?>&option=xem" title="Chi tiết"><img src="../anh/chitiet.png" height="13" width="13" border="0">
								Chi tiết
							</a>
							</td>							
						</tr>
						<tr><td><div class="noidungnhanxet"></div></td></tr>											
					<? }?>
					<tr><td>
						<? 
							for($i = 1; $i <=$num_page; $i++)
							if ($i==$page)  echo "&nbsp;Trang&nbsp;".$i."&nbsp;";
							else echo "&nbsp;<a href=?page={$i}>&nbsp;Trang&nbsp;{$i}</a>&nbsp;";
						?>	
					</td></tr>
					<?
					}
				?>
			</table>	
	</div>
	<!--End cac cap nhat thong tin bo sung cua hoc sinh-->	
	  		
<!-- InstanceEndEditable --></td>
</tr>
<tr><td colspan="2" height="100" valign="middle" align="center" bgcolor="#999999">Phạm Đức Đóa - Khoa CNTT - Đại học Xây Dựng</td></tr>
</table>
</body>
<!-- InstanceEnd --></html>
